package com.etong.citymap.util;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;

public class ContentProvicerUtil {
	public static Cursor selectData(Context context,Uri uri,String where){
		ContentResolver resolver = context.getContentResolver();
		Cursor cursor = resolver.query(uri, null,where, null, null);
		return cursor;
	}
	
	public static Uri insertData(Context context,Uri uri,ContentValues values){
		ContentResolver resolver = context.getContentResolver();
		return resolver.insert(uri, values);
	}
	
	public static int deleteData(Context context,Uri uri,String where){
		ContentResolver resolver = context.getContentResolver();
		return resolver.delete(uri, where,null);
		
	}
	public static int updateData(Context context,Uri uri,String where,ContentValues values){
		ContentResolver resolver = context.getContentResolver();
		return resolver.update(uri, values, where, null);
	}
	
}
